package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.OpinionMapper;
import com.jieshuibao.model.db.Opinion;
import com.jieshuibao.model.db.OpinionExample;

@Service
public class OpinionService{
	
	@Resource
	private OpinionMapper opinionMapper;
	
	public void addOpinion(Opinion opinion) {
		opinionMapper.insertSelective(opinion);
	}
	
	public void delOpinionByUuid(String uuid) {
		opinionMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateOpinion(Opinion opinion) {
		opinionMapper.updateByPrimaryKeySelective(opinion);
	}
	
	public Opinion getOpinionByUuid(String uuid) {
		return opinionMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Opinion> getPageOpinion(OpinionExample opinionExample) {
		return opinionMapper.selectPage(opinionExample);
	}
	
	public int countOpinion(OpinionExample opinionExample) {
		return opinionMapper.countByExample(opinionExample);
	}
}
